package com.jeff.android.lab;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

import com.jeff.android.lab.util.RouterUtil;

/**
 * @author: dingfeng
 * @date: 2020-05-22
 * @since: 1.0.0
 **/
public class SplashActivity extends BaseActivity {

    private String mSkipUrl;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        handleIntent(getIntent());

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                RouterUtil.launchActivity(SplashActivity.this, MainActivity.class);
                finish();
            }
        }, 500);
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        handleIntent(intent);
    }

    private void handleIntent(Intent intent) {
        if (intent != null) {
            mSkipUrl = intent.getDataString();
        }
    }

}
